<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        span{
            border-bottom:1px double red;
            width: 100px;
            display: inline-block;
        }
        input{
            border: none;
            border-bottom: 1px dashed green;
            outline: none;
        }
    </style>
</head>
<body>
    <fieldset id="box">
        <legend>edit案例.html</legend>
        <p v-for="(v,k,i) in obj">
            <b>{{k}}:</b>
            <input type="text" v-if="boole" v-model="obj[k]" @blur="boole2">
            <span @dblclick="boole1(v,k,i)" v-if="bbb">{{v}}</span>
        </p>
    </fieldset>

    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
  

        let vm = new Vue({
            el:'#box',
            data:{
                boole:false,
                bbb:true,
                
                obj:{
                        姓名:'章群',
                        年龄:98,
                        爱好:'写代码',
                        性别:'半男半女'
                    }
            },
            methods: {
                boole1(v,k,i){
                    this.boole=true
                    this.bbb=false
                
                },
                boole2(){
                    this.boole=false
                    this.bbb=true
                }
            }
        })


    </script>
</body>
</html>